package com.example.blog.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class AppConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor()).
                addPathPatterns("/**").
                excludePathPatterns("/user/login").
                excludePathPatterns("/user/reg").
                excludePathPatterns("/user/upuser").
                excludePathPatterns("/editor.md/**").
                excludePathPatterns("/css/**").
                excludePathPatterns("/image/**").
                excludePathPatterns("/js/**").
                excludePathPatterns("/login.html").
                excludePathPatterns("/reg.html").
                excludePathPatterns("/blog_list.html").
                excludePathPatterns("/uppwd.html").
                excludePathPatterns("/upworderror.html");
    }
}
